package demo02;

public class Person {
    private   String name;
    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return name;
    }
    private int age;
    public void setAge(int age){
        if(age<0){
            System.out.println("你输入的年龄是不符合规范不能为负数");
        }
        else {
            this.age = age;
        }
    }
    public int getAge(){
        return age;
    }
    public  void play(){
        System.out.println("人类可以继续活动");
    }
}
